using Newtonsoft.Json;
using System;
using System.ComponentModel.DataAnnotations.Schema;

namespace Simple.Contracts.Models
{
    /// <summary>
    /// 照护计划模板模型
    /// </summary>
    public class CarePlanTemplateModel
    {
        
    }

    /// <summary>
    /// 保存照护计划模板参数
    /// </summary>
    public class SaveCarePlanTemplateInput
    {
        /// <summary>
        /// 模板Id（新增时不传，编辑时必传）
        /// </summary>
        public long? Id { get; set; }

        /// <summary>
        /// 模板名称
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 个性化照护需求
        /// </summary>
        public string? PersonalizedCareNeeds { get; set; }

        /// <summary>
        /// 排序
        /// </summary>
        public int? Sort { get; set; }

        /// <summary>
        /// 照护计划模板照护任务信息
        /// </summary>
        public List<CarePlanTemplateMissionDto>? MissionList { get; set; }
    }

    /// <summary>
    /// 照护计划模板信息
    /// </summary>
    public class CarePlanTemplateDto
    {
        /// <summary>
        /// 模板Id
        /// </summary>
        public long Id { get; set; }

        /// <summary>
        /// 公司Id
        /// </summary>
        public long CompanyId { get; set; }

        /// <summary>
        /// 模板名称
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 个性化照护需求
        /// </summary>
        public string? PersonalizedCareNeeds { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreateTime { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public string CreateTimeText { get { return CreateTime.ToString("yyyy-MM-dd"); } }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime UpdateTime { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public string UpdateTimeText { get { return UpdateTime.ToString("yyyy-MM-dd"); } }

        /// <summary>
        /// 排序
        /// </summary>
        public int? Sort { get; set; }

        /// <summary>
        /// 照护计划模板照护任务信息
        /// </summary>
        public List<CarePlanTemplateMissionDto> MissionList {  get; set; }
    }

    /// <summary>
    /// 照护计划模板照护任务信息
    /// </summary>
    public class CarePlanTemplateMissionDto
    {
        /// <summary>
		/// 主键Id
		/// </summary>
        public long? Id { get; set; }

        /// <summary>
        /// 照护项目分类Id
        /// </summary>
        public long CategorizeId { get; set; }

        /// <summary>
        /// 照护项目Id
        /// </summary>
        public long CareMissionId { get; set; }

        /// <summary>
        /// 照护项目名称
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 照护项目描述、注意事项
        /// </summary>
        public string? Description { get; set; }

        /// <summary>
        /// 是否每日照护任务：0=否、1=是
        /// </summary>
        public int IsDailyMission { get; set; } = 1;

        /// <summary>
        /// 每日照护任务：建议开始时间（HH:mm）
        /// </summary>
        public string? DailyMissionStartTime { get; set; }

        /// <summary>
        /// 每日照护任务：建议结束时间（HH:mm）
        /// </summary>
        public string? DailyMissionEndTime { get; set; }

        /// <summary>
        /// 每日照护任务：建议开始时间（HHmm）
        /// </summary>
        public int? DailyMissionStartTimeValue { get; set; }

        /// <summary>
        /// 每日照护任务：建议结束时间（HHmm）
        /// </summary>
        public int? DailyMissionEndTimeValue { get; set; }

        /// <summary>
        /// 每日照护任务：建议执行次数
        /// </summary>
        public int? DailyMissionExecutionCount { get; set; }

        /// <summary>
        /// 更新时间
        /// </summary>
        public DateTime? UpdateTime { get; set; }

        /// <summary>
        /// 更新时间
        /// </summary>
        public string? UpdateTimeText { get { return UpdateTime?.ToString("yyyy-MM-dd HH:mm"); } }

        /// <summary>
        /// 排序
        /// </summary>
        public int? Sort { get; set; }

        /// <summary>
        /// 是否删除：0=未删除、1=已删除
        /// </summary>
        public int IsDelete { get; set; }
    }

    /// <summary>
    /// 复制照护计划模板
    /// </summary>
    public class CopyCarePlanTemplateInput
    {
        /// <summary>
        /// 模板Id
        /// </summary>
        public long Id { get; set; }

        /// <summary>
        /// 模板名称
        /// </summary>
        public string Name {  set; get; }
    }
}